package com.ankang.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
*   @author mjiajia
*   @date 2025/8/30 02:17
*   @desciption
 *
*/
@Aspect
@Component
@Slf4j
public class WebLogAspect {
    private Logger logger = LoggerFactory.getLogger(this.getClass());
    @Pointcut("execution(public * com.ankang..*.*(..))")
    public void webLog() {}

    @Before("webLog()")
    public void doBefore(JoinPoint joinPoint) {
        // 记录请求进入的日志
    }

    @AfterReturning(returning = "ret", pointcut = "webLog()")
    public void doAfterReturning(Object ret) {
        // 记录请求返回的日志
    }
}
